package com.Sing.Service;

import com.Sing.Dao.BookMapper;
import com.Sing.Pojo.Book;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.HashMap;

public class BookServiceImpl implements BookService {

    private BookMapper mapper;
    @Autowired
    public void setMapper(BookMapper mapper) {
        this.mapper = mapper;
    }

    @Override
    public ArrayList<Book> getAllData() {
        return mapper.getAllData();
    }

    @Override
    public ArrayList<Book> getData(int page, int limit, String name, String isbn, String typeId) {
        return mapper.getData( page, limit, name, isbn, typeId );
    }

    @Override
    public int getDataCount(String name, String isbn, String typeId) {
        return mapper.getDataCount( name, isbn, typeId );
    }

    @Override
    public ArrayList<Book> getCountByType() {
        return mapper.getCountByType();
    }

    @Override
    public boolean modifyData(HashMap<String, Object> paramMap) {
        return mapper.modifyData( paramMap );
    }

    @Override
    public Book queryBookById(int id) {
        return mapper.queryBookById( id );
    }

    @Override
    public boolean addBook(Book book) {
        return mapper.addBook( book );
    }

    @Override
    public boolean deleteBook(int id) {
        return mapper.deleteBook( id );
    }

    @Override
    public boolean modifyStatus(int status,int bookId) {
        return mapper.modifyStatus(status, bookId);
    }

}
